package fnord.illuminati.card;

import java.io.Serializable;

import fnord.illuminati.action.ActionType;
import fnord.illuminati.action.AttackModifierAction;

public abstract class Card implements Serializable {
	private static final long serialVersionUID = -2468263865870627234L;
	private static int idCounter = 0;
	
	protected String _name;
	protected String _description;
	protected Object _action;
	protected ActionType _actionType;
	protected ActionTime _actionTime;
	int id;
	
	public String getName() { return _name; }
	public String getDescription() { return _description; }
	public Object getAction() { return _action; }
	public ActionTime getActionTime() { return _actionTime; }
	
	public Card() { return; }
	public Card(String name, String description, Object action,
			ActionTime actionTime) {
		id = Card.idCounter++;
		_name =  name;
		_description = description;
		_action = action;
		_actionTime = actionTime;
		if (_action instanceof AttackModifierAction)
			_actionType = ActionType.ATTACK_MODIFIER_ACTION;
	}
	
	public int getId() {
		return id;
	}
	
	boolean sameAs(Card c) {
		return c.getId() == this.id;
	}
	
}
